home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 38 / Amiga Format CD38 (1999-03-15)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-04].iso / -seriously_amiga- / programming / other / cyberxxxsrc / misc / iconsupport.mod < prev    next >
Text File  |  1999-02-08  |  3KB  |  79 lines

  1. MODULE  IconSupport;
  2.  
  3. (* $StackChk- $OvflChk- $RangeChk- $CaseChk- $ReturnChk- $NilChk- $TypeChk- $OddChk- $ClearVars- *)
  4.  
  5. (* /// ------------------------------- "IMPORT" -------------------------------- *)
  6. IMPORT  c:=Conversions,
  7.         e:=Exec,
  8.         ic:=Icon,
  9.         wb:=Workbench;
  10. (* \\\ ------------------------------------------------------------------------- *)
  11.  
  12. (* /// ---------------------- "PROCEDURE GetTTValueInt()" ---------------------- *)
  13. PROCEDURE GetTTValueInt * (icon: wb.DiskObjectPtr;
  14.                            tt: ARRAY OF CHAR;
  15.                            def: LONGINT): LONGINT; (* $CopyArrays- *)
  16.  
  17. VAR     dummyInt: LONGINT;
  18.         toolStr: e.LSTRPTR;
  19.  
  20. BEGIN
  21.   toolStr:=ic.FindToolType(icon.toolTypes,tt);
  22.   IF toolStr#NIL THEN
  23.     IF c.StringToInt(toolStr^,dummyInt) THEN END;
  24.     RETURN dummyInt;
  25.   ELSE
  26.     RETURN def;
  27.   END;
  28. END GetTTValueInt;
  29. (* \\\ ------------------------------------------------------------------------- *)
  30.  
  31. (* /// ---------------------- "PROCEDURE GetTTValueStr()" ---------------------- *)
  32. PROCEDURE GetTTValueStr * (icon: wb.DiskObjectPtr;
  33.                            tt: ARRAY OF CHAR;
  34.                            def: e.STRING): e.STRING; (* $CopyArrays- *)
  35.  
  36. VAR     dummyStr: e.STRING;
  37.         toolStr: e.LSTRPTR;
  38.  
  39. BEGIN
  40.   toolStr:=ic.FindToolType(icon.toolTypes,tt);
  41.   IF toolStr#NIL THEN
  42.     COPY(toolStr^,dummyStr);
  43.     RETURN dummyStr;
  44.   ELSE
  45.     RETURN def;
  46.   END;
  47. END GetTTValueStr;
  48. (* \\\ ------------------------------------------------------------------------- *)
  49.  
  50. (* /// --------------------- "PROCEDURE GetTTValueBool()" ---------------------- *)
  51. PROCEDURE GetTTValueBool * (icon: wb.DiskObjectPtr;
  52.                             tt: ARRAY OF CHAR;
  53.                             def: BOOLEAN): BOOLEAN; (* $CopyArrays- *)
  54.  
  55. VAR     toolStr: e.LSTRPTR;
  56.  
  57. BEGIN
  58.   toolStr:=ic.FindToolType(icon.toolTypes,tt);
  59.   IF toolStr#NIL THEN
  60.     RETURN (ic.MatchToolValue(toolStr^,"TRUE") OR
  61.             ic.MatchToolValue(toolStr^,"YES") OR
  62.             ic.MatchToolValue(toolStr^,"ON") OR
  63.             ic.MatchToolValue(toolStr^,"1"));
  64.   ELSE
  65.     RETURN def;
  66.   END;
  67. END GetTTValueBool;
  68. (* \\\ ------------------------------------------------------------------------- *)
  69.  
  70. (* /// --------------------- "PROCEDURE LookupToolType()" ---------------------- *)
  71. PROCEDURE LookupToolType * (icon: wb.DiskObjectPtr;
  72.                             tt: ARRAY OF CHAR): BOOLEAN; (* $CopyArrays- *)
  73. BEGIN
  74.   RETURN (ic.FindToolType(icon.toolTypes,tt)#NIL);
  75. END LookupToolType;
  76. (* \\\ ------------------------------------------------------------------------- *)
  77.  
  78. END IconSupport.
  79.